package sctu.edu.java.year2016.team01.xuhanmei.day20160524.practice4;

/**
 * Created by Administrator on 2016/5/24...
 */

import java.text.NumberFormat;
import java.util.Scanner;
import java.util.Locale;

public class Format1 {
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        System.out.println("请输入一个数目：");
        double money = scan.nextDouble();


        NumberFormat format = NumberFormat.getCurrencyInstance(Locale.CHINA);
        System.out.println("Locale.CHINA:" + format.format(money));


        format = NumberFormat.getCurrencyInstance(Locale.US);
        System.out.println("Locale.US:" + format.format(money));


        format = NumberFormat.getCurrencyInstance(Locale.ENGLISH);
        System.out.println("Locale.ENGLISH:" + format.format(money));
    }
}
